package com.web;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.Toast;

public class WebPopActivity extends Activity implements OnClickListener {
    /** Called when the activity is first created. */
	
	AlertDialog.Builder dialog;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.another);
        
        WebView webView = (WebView) findViewById(R.id.webView);
        webView.loadUrl("google.com");
        Button button = (Button) findViewById(R.id.btn);
        
        button.setOnClickListener(this);
    }
    
    
    


	public void onClick(View arg0) {
		// TODO Auto-generated method stub
		  dialog = new AlertDialog.Builder(this).setTitle("hello").setMessage("hi there").setPositiveButton("click the button", new DialogInterface.OnClickListener() {
			
			public void onClick(DialogInterface dialog, int which) {
				
				Toast toast =	Toast.makeText(getApplicationContext(), "you clicked the button", Toast.LENGTH_SHORT);
				toast.show();
				
				
			}
		}).setNegativeButton("no", new DialogInterface.OnClickListener() {
			
			public void onClick(DialogInterface dialog, int which) {
				
				Toast toast =	Toast.makeText(getApplicationContext(), "bye bye", Toast.LENGTH_SHORT);
				toast.show();
				
				
			}
		}).setNeutralButton("popopopop", new DialogInterface.OnClickListener() {
			
			public void onClick(DialogInterface dialog, int which) {
				
				Toast toast = Toast.makeText(getApplicationContext(), "pop up", Toast.LENGTH_SHORT);
				toast.show();
				
			}
		});
		  
		  dialog.show();
		
		  

		
	}
    
    
    
}